package com.isasc.demo.pooled.itemqueue;

import lombok.Data;

import java.util.Date;
import java.util.UUID;

/**
 * @author: ywy
 * @date: 2023-01-31
 * @desc:
 */
@Data
public class QueueItem {
    private String id;
    private String type;
    private long createTimestamp;

    public QueueItem(String id, String type) {
        this.id = id;
        this.type = type;
    }

    public static QueueItem init() {
        try {
            // sleep
            Thread.sleep(10);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        QueueItem queueItem = new QueueItem(UUID.randomUUID().toString(), "hello");
        queueItem.setCreateTimestamp(System.currentTimeMillis());
        return queueItem;
    }
}
